package Entity;

import java.io.Serializable;

import javax.persistence.*;

import java.util.ArrayList;
import java.util.List;


/**
 * The persistent class for the pcr_tube database table.
 * 
 */
@Entity
@Table(name="pcr_tube")
@NamedQuery(name="PcrTube.findAll", query="SELECT p FROM PcrTube p")
public class PcrTube implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	public String id;

	public String status;

	public String collect_time;
	
	public String result_time;
	
	//bi-directional many-to-many association to User
	
	@ManyToMany(fetch=FetchType.EAGER)
	@JoinTable(name="tube_user", 
	inverseJoinColumns={
           @JoinColumn(name="user_id",
                        referencedColumnName="ID")
         }, 
    joinColumns={
            @JoinColumn(name="tube_id",
                        referencedColumnName="ID")
                } )
	public List<User> users=new ArrayList<User>();


	@Override
	public String toString() {
		return "PcrTube [id=" + id + ", status=" + status + ", collectTime="
				+ collect_time + ", resultTime=" + result_time + ", users="
				+ users + "]";
	}

	public String getCollect_time() {
		return collect_time;
	}

	public void setCollect_time(String collect_time) {
		this.collect_time = collect_time;
	}

	public String getResult_time() {
		return result_time;
	}

	public void setResult_time(String result_time) {
		this.result_time = result_time;
	}

	public PcrTube() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public List<User> getUsers() {
		return this.users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

}